#!/usr/bin/env sh
# scspell-id: ab2424a8-3965-11f0-80a8-80ee73e9b8e7
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: The DPS8M Development Team

set -e

# Stuff
OUTDIR="../hpages/content/Family_Trees/images"
test -d "${OUTDIR:?}"
rm -f ./"${OUTDIR:?}"/*.svg

dot -Tsvg < hfam.dot  > "${OUTDIR:?}/hfam.svg"
dot -Tsvg < osfam.dot > "${OUTDIR:?}/osfam.svg"

sed -e 's/"black"/PLACEHOLDER/g' -e 's/"white"/"black"/g' -e 's/PLACEHOLDER/"white"/g' hfam.dot | dot -Tsvg > "${OUTDIR:?}/hfam_black.svg"
sed -e 's/"black"/PLACEHOLDER/g' -e 's/"white"/"black"/g' -e 's/PLACEHOLDER/"white"/g' osfam.dot | dot -Tsvg > "${OUTDIR:?}/osfam_black.svg"

ls -l "${OUTDIR:?}"/*.svg
